The present invention provides improvements in or relating to machine vision equipment, and has particular reference to a method and apparatus for automatically setting-up such machine vision equipment.
Co-pending international patent application no. PCT/GB2004/001181, corresponding to earlier United Kingdom application no. 0306468.0, the contents of which international application are fully incorporated herein by reference, discloses a method and apparatus for determining one or more physical properties of a rolled smoking article or filter rod, comprising positioning a rolled smoking article or filter rod within a field of view, illuminating the field of view, imaging the rolled smoking article or filter rod within the field of view to form an image, and analysing the image to determine one or more physical properties of the rolled smoking article or filter rod. Typically, the image is a digital image which is acquired using a digital camera, preferably a digital video camera. The image may be acquired using any wavelength or range of wavelengths, for example infrared light. Thus, the image comprises a digital array of pixels which may be analysed using suitable processing means to determine one or physical properties of the rolled smoking article or filter rod such as its length, diameter, ovality, and the like.
As described in co-pending PCT/GB2004/001181, analysis of the digital image may be performed using well-known algorithms to detect edges within the image.
Such algorithms may employ contrast levels for defining a point at which an edge is defined as being present, the length (in pixels) along a detected edge being used to determine a contiguous and true edge, and algorithms for carrying out statistical probability calculations to confirm that a detected edge is a true edge. A preferred technique for detecting an edge within an image comprises generating horizontal and vertical region projections within a region of interest of the image, and then analysing the projections in order to detect any significant edges. Such image processing techniques are not described further herein, but are described in a number of standard reference works including Sonka, et al., 1999, Image Processing, Analysis and Machine Vision, 2nd Edition, page 356 (6.35), Pacific Grove: PWS Publishing, ISBN 0-534-95393-X, the contents of which are incorporated herein by reference.
The accurate detection of edges within a digital image by imaging processing techniques of the kind described above relies on such edges being sharply in focus within the image, to allow the edges to be detected without undue exposure of the image which might lead to undesirable affects such as “blooming”, which is associated with many digital imaging devices, particularly those comprising CCD-type sensors.
The machine vision equipment is also required to be calibrated to provide accurate conversion of distances measured in pixels in the image to actual distances measured, for example, in millimeters or inches.
Calibration of machine vision equipment is typically carried out using reference objects of accurately known dimensions. A known reference object comprises a machined solid steel cylinder having an accurately known diameter. Steel reference objects are used in view of their good dimensional stability. However, metal reference objects are not suitable for calibrating machine vision equipment of the kind described by co-pending PCT/GB2004/001181 in view of the high reflectance of the metal.
Furthermore, it is generally inconvenient manually to place a reference object in the field of view of the machine vision equipment for intermittent calibration and re-calibration.
There is therefore a need for a dimensionally stable reference object which is suitable for use for calibrating machine vision equipment of the kind disclosed by co-pending PCT/GB2004/001181.
There is also a requirement for a method of automatically setting-up such machine vision equipment.
In accordance with one aspect of the invention therefore there is provided a dimensionally stable reference object having at least one accurately known dimension which is fabricated from a ceramic material having a low reflectance or albedo value. Preferably, the reference object comprises a cylindrical bar having an accurately known diameter.
Said ceramic material may comprise a ceramic alumina. Preferably, the ceramic material has an alumina content of more than about 70% by weight, and more preferably more than about 90% or 95% by weight. The ceramic material should be substantially impervious and should have good refractory properties, for example, refractoriness up to about 1700° C. Apart from alumina, the ceramic material may comprise various other ceramic constituents, particularly magnesium oxide. In some embodiments, the ceramic material comprise about 99.7% weight alumina, with the balance being substantially magnesium oxide. A suitable ceramic material available commercially from W Haldenwanger Technishe Keramik GmbH & Co KG, Germany, under the trade mark “Alsint 99,7”.
In another aspect of the present invention there is provided machine vision equipment incorporating automatic set-up means; said equipment comprising:
imaging means comprising a camera defining a field of view and being adapted to form an image of test object within said field of view, and processing means for processing said image for determining one or more physical properties of said test object; and
first supporting means for supporting a test object within said field of view at a predetermined distance from said camera;
characterised by:
second supporting means for supporting a reference object having a least one accurately known dimension;
moving means for selectively moving one or more of the camera, the first supporting means, and the second supporting means such that a reference object placed on the second supporting means is disposed within the camera's field of view at said predetermined distance from said camera;
adjusting means for automatically adjusting the configuration of the imaging means;
optimum configuration determining means for determining the optimum configuration of said imaging means by processing one or more images of a reference object placed on a the second supporting means; and
controlling means for controlling operation of the moving means, imaging means, adjusting means and optimum configuration determining means for bringing a reference object supported by said second supporting means into the camera's field of view, imaging said reference object, determining the optimum configuration of the imaging means, and adjusting the imaging means to said optimum configuration.
In yet another aspect of the present invention there is provided a method of setting-up machine vision equipment, said equipment comprising imaging means comprising a camera defining a field of view and being adapted to form an image of a test object within said field of view, and processing means for processing said image for determining one of more physical properties of said test object, and first supporting means for supporting a test object at a predetermined distance from the camera within the field of view;
said method being characterised by:
providing second supporting means for supporting at least one reference object;
placing a reference object having at least one accurately known dimension on said second supporting means;
selectively moving one or more of the camera, the first supporting means and the second supporting means, such that said reference object is brought into the camera's field of view at said predetermined distance from the camera;
imaging the reference object to obtain at least one image, and processing said at least one image to determine the optimum configuration of the imaging means;
and thereafter adjusting the configuration of the imaging means to said optimum configuration.
In accordance with the present invention therefore, a reference object having at least one accurately known dimension may be placed on the second supporting means, and when the machine vision equipment is required to be set-up, or the set-up of machine vision equipment is required to be checked, the controlling means cause the reference object on the second supporting means to be brought into the camera's field of view at the same predetermined distance from the camera as a test object on the first supporting means during normal operation of the machine vision equipment. The reference object is then imaged, and the image is processed to determine the optimum set-up of the imaging means; the imaging means are then adjusted to said optimum set-up. The reference object may then be removed from the camera's field of view and replaced by said first supporting means for use or continued use of the machine vision equipment for determining one or more physical properties of a test object.
In some embodiments, said optimum configuration determining means may be adapted for determining the optimum configuration of the imaging means by processing a plurality of images of said reference object obtained with said imaging means in different respective configurations, and said controlling means may be adapted to control said imaging means, adjusting means and optimum configuration determining means to obtain and process serial images of said reference object whilst adjusting progressively the configuration of the imaging means, and to determine the optimum configuration on the basis of said serial images.
Thus, as disclosed in co-pending PCT/GB2004/001181, the camera may comprise means for automatically adjusting the focal length of the camera. For example, the camera may comprise a barrel portion housing a lens, and said barrel portion may be provided with a gear which is adapted to be driven by a toothed belt from a DC motor controlled by said controlling means. As described above, it is important, when measuring dimensions of a test object by analysing a digital image of the test object to detect the presence of significant edges, to ensure that the image of the test object is properly in focus. Thus, in accordance with the present invention, the optimum configuration determining means may comprise optimum focal length determining means, and said controlling means may be adapted for controlling the adjusting means, imaging means and optimum focal length determining means to obtain and process serial images of the reference object at different respective focal lengths, and to determine the optimum focal length at which the reference object is best in focus, and for controlling the adjusting means thereafter to adjust the focal length of the camera to said optimum focal length.
The second supporting means are preferably configured to support a reference object having substantially the same shape and size in substantially the same orientation in the field of view as the test object. Where the test object comprises a rolled smoking article or filter rod, the reference object suitably comprises a cylindrical bar having substantially the same diameter as the rolled smoking article or filter rod. In order to measure the diameter of a rolled smoking article or filter rod, a digital image of the rolled smoking article or filter rod is analysed to detect opposite, substantially parallel edges of a profile of the rolled smoking article or filter rod in the image, which profile corresponds to a cross-section through the rolled smoking article or filter rod through its central axis. Thus, in order to ensure that said opposite edges are properly focused in the image, the camera should be focused on the centre axis of the rolled smoking article or filter rod. Preferably, therefore the second supporting means are configured to support a cylindrical reference bar in an orientation substantially orthogonal to the optical axis of the camera.
Preferably the camera comprises a digital camera which is adapted to form the image as a regular array of pixels.
In some embodiments, said configuration determining means may comprise calibration determining means adapted to compare an actual measured value of said at least one dimension of said reference object with said accurately known value; said adjusting means may be adapted for adjusting the calibration of said imaging means; said controlling means may be configured for controlling said imaging means, calibration determining means, and adjusting means, for measuring said at least one dimension of said reference object to obtain a measured value, comparing said measured value with the accurately known value, and adjusting the calibration of the imaging means accordingly, such that the measured value equals the known value. In this way, the controlling means may generate a calibrated conversion factor for converting distances in the image of a test object, measured in pixels, to actual distances, measured in, for example, millimeters or inches.
Those skilled in the art will know that diameter measurements using machine vision equipment may be sensitive to optical effects associated with the camera. Accordingly, a calibration curve of actual length versus pixels may be non-linear. Accordingly, it is desirable to calibrate the machine vision equipment at least two different known diameters, and then to interpolate between those known diameters to establish a calibrated scale.
Thus, in accordance with a particular aspect of the present invention said second supporting means may be adapted to support a plurality of reference objects, each having substantially the same shape as the test object, but each having a different respective, accurately known value of said at least one dimension; said moving means may be adapted for selectively moving said one or more of the camera, first supporting means and second supporting means to bring each reference object in turn into the camera's field of view at the predetermined distance from the camera; said calibration determining means may be adapted for comparing the measured value of said at least one dimension of each reference object with the respectively accurately known value, and to generate a calibration curve for said imaging means on the basis of said comparisons.
In some embodiments, said second supporting means may be adapted to support three reference objects. As described above, each reference object may comprise a cylindrical bar of accurately known diameter.
The reference objects may be interchangeable in order to calibrate the machine vision system for dimension measurements within different ranges. By supporting three reference objects the second supporting means may be adapted, for any given measurement range, to support reference objects having accurately known dimensions respectively at or towards each end of the measurement range and at an arbitrary dimension intermediate said two ends, for example substantially towards the middle of the measurement range.
Thus, the provision of five reference objects allows the machine vision equipment in accordance with the present invention to be calibrated with three-point calibration for use in three different, but overlapping, measurement ranges.
Conveniently, said second supporting means may comprise at least one holder for holding each reference object, each holder defining a v-shaped cavity which is configured to receive transversely the cylindrical reference bar at the same depth into the cavity regardless of the diameter of the bar. In some embodiments, said second supporting means may comprise two holders for holding each reference object, one holder at or towards each end of the respective bar. In this way, each reference object can easily be positioned at said predetermined distance from the camera, irrespective of the diameter of the reference object. It will be appreciated that by placing each reference object on the second supporting means at the same predetermined distance from the camera, the central axes of the reference objects will be positioned at different respective distances from the camera. However, the actual differences in diameter between the reference objects will be small, and within the allowed tolerance of the focus of the camera. Accordingly, there is no need in practice to re-adjust the focal length of the camera for imaging and calibrating against each reference object.
The present invention therefore provides improvements in or relating to machine vision equipment, particularly equipment of the kind described by co-pending PCT/GB2004/001181 by providing a method and apparatus for automatically setting-up the machine vision equipment; in particular to set-up automatically the focal length and calibration of the machine vision equipment. The present invention also provides a suitable ceramic reference object for use in the automatic setting-up method of the present invention.